//! Header for the Rectangle-class
/*!
	\file Rectangle.h
	\author Andreas Lehner
	\date 13.11.2012

*/
#ifndef RECTANGLE_H
#define RECTANGLE_H

#include "Shape.h"

//! Describes a Rectangle (holds its dimensions and gets position from Shape)
/*!
\class Rectangle
The class Rectangle holds information of a Rectangle (width and height) and gets its position from the
class Shape. Writes a rectangle to ostream and delegates output function (DoWrite) to filled and transparent rectangles.
(Template Method)
*/
class Rectangle : public Shape {
public:
	//! CTor of Rectangle
	/*!
	Constructs a rectangle by initializing its position, size (width and height) and color. Position and color are set in Shape
	(Shape constructor is called).
	\param pos The position of the rectangle on a picture.
	\param size The dimensions of a rectangle.
	\param color The color a rectangle has.
	*/
	Rectangle(TPosition const& pos, TSize const& size, std::string const& color) : Shape(pos, color), mHeight(size.height), mWidth(size.width){};

	void WriteShape(std::ostream & stream);
protected:
	//! the height of a rectangle
	/*!
	mHeight describes the height (y-value) of a rectangle
	*/
	float mHeight;
	//! the width of a rectangle
	/*!
	mWidth describes the width (x-value) of a rectangle
	*/
	float mWidth;
	//! Write a rectangle to ostream
	/*!
	Write a rectangle (filled or transparent) to ostream. (abstract method)
	\param stream The stream where output is written to.
	*/
	virtual void DoWrite(std::ostream & stream) = 0;
};

#endif